import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Demo3VO, Demo3Form, Demo3Query } from '@/api/demo/demo3/types';

/**
 * 查询测试单列表
 * @param query
 * @returns {*}
 */
export const listDemo3 = (query?: Demo3Query): AxiosPromise<Demo3VO[]> => {
  return request({
    url: '/demo/demo3/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询测试详细
 * @param id
 */
export const getDemo3 = (id?: string | number): AxiosPromise<Demo3VO> => {
  return request({
    url: '/demo/demo3/' + id,
    method: 'get'
  });
};

/**
 * 新增测试
 * @param data
 */
export const addDemo3 = (data: Demo3Form) => {
  return request({
    url: '/demo/demo3',
    method: 'post',
    data: data
  });
};

/**
 * 修改测试
 * @param data
 */
export const updateDemo3 = (data: Demo3Form) => {
  return request({
    url: '/demo/demo3',
    method: 'put',
    data: data
  });
};

/**
 * 删除测试
 * @param id
 */
export const delDemo3 = (id: string | number | Array<string | number>) => {
  return request({
    url: '/demo/demo3/' + id,
    method: 'delete'
  });
};

